package com.car.service.impl;

import com.car.dao.EmpMapper;
import com.car.entity.Emp;
import com.car.service.IEmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @author: hsy
 * @version: v1.0
 * @Date
 */
@Service("empService")
public class EmpService implements IEmpService {
    @Autowired
    @Qualifier("empMapper")
    private EmpMapper empMapper;

    //查找员工
    @Override
    public List<Emp> findAll() {
        return empMapper.findAll();
    }

    //根据id查找
    @Override
    public Emp findById(int eid) {
        return empMapper.findById(eid);
    }

    //修改员工信息
    @Override
    public int updateEmp(Emp emp) {
        return empMapper.updateEmp(emp);
    }

    //增加员工
    @Override
    public int addEmp(Emp emp) {
        System.out.println("添加员工");
        return empMapper.addEmp(emp);
    }

    //查找员工状态
    @Override
    public List<Emp> findStatus(String status) {
        return empMapper.findStatus(status);
    }
}
